package com.lzy.cloud.order.service.impl;

import com.lzy.cloud.order.dtos.OrderAppealDto;
import com.lzy.cloud.order.entity.OrderAppeal;
import com.lzy.cloud.order.entity.OrderAssessContent;
import com.lzy.cloud.order.mapper.OrderAppealMapperExt;
import com.lzy.cloud.order.service.OrderAppealService;
import com.lzy.framework.core.utils.DozerUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @description:消费者订单投诉信息
 * @author: liyun
 * @create: 2018-07-06 16:13
 */
@Service
public class OrderAppealServiceImpl implements OrderAppealService {
    @Autowired
    private OrderAppealMapperExt orderAppealMapperExt;

    @Override
    public OrderAppealDto queryByOrderId(String orderId) {
        return orderAppealMapperExt.queryByOrderId(orderId);
    }

    @Override
    public Long create(OrderAppealDto orderAppealDto) {
        OrderAppeal orderAppeal = DozerUtils.map(orderAppealDto, OrderAppeal.class);
        return orderAppealMapperExt.insertSelective(orderAppeal)>0 ? orderAppeal.getId() : 0;
    }
}
